package Principal;

import java.math.BigDecimal;
import java.util.List;

public abstract class Evento {
	
	
	protected BigDecimal tempoExecucao;
	protected Host host;
	protected HistoriaSimulacao historiaSimulacao;
	protected List<Host> hostsSistema;
	protected Estatistica estatistica;
	protected boolean verbose;
		
	
	public Evento(BigDecimal _tempoExecucao, Host _host, HistoriaSimulacao _historiaSimulacao, Estatistica _estatistica, List<Host> _hostsSistema){		
		tempoExecucao = _tempoExecucao ;
		host = _host;
		historiaSimulacao = _historiaSimulacao;
		hostsSistema = _hostsSistema;
		estatistica = _estatistica;
		verbose = false;
	}
	
	public BigDecimal getTempoExecucao(){
		return tempoExecucao;
	}
	
	public abstract void executar();
	
	protected int getNumeroHost(){
		for (int numeroHost =0; numeroHost< hostsSistema.size(); numeroHost++){
			if(host.equals(hostsSistema.get(numeroHost))){
				return numeroHost+1;
			}
		}
		return 0;
	}
}


